<h3>text</h3>
<div style="float:left;">
    <div id="kineticjs_rectangle"></div>
</div>

<div style="float:right;width:50%;">
    <textarea style="width: 90%;height: 300px;" id="code_kineticjs_rectangle">
    
    var stage = new Kinetic.Stage({
        container: 'kineticjs_rectangle',
        width: 578,
        height: 200
      });

      var layer = new Kinetic.Layer();

      var rect = new Kinetic.Rect({
        x: 239,
        y: 75,
        width: 100,
        height: 50,
        fill: 'green',
        stroke: 'black',
        strokeWidth: 4
      });

      // add the shape to the layer
      layer.add(rect);

      // add the layer to the stage
      stage.add(layer);
      
    </textarea><br />
    <input type="button" value="run" onclick="run_code('#code_kineticjs_rectangle')" />
    
</div>
<script type="text/javascript">
<!--
	$(function(){
	   run_code('#code_kineticjs_rectangle');
	})
-->
</script>
